/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelPaso2.java
 *
 * Created on 11-nov-2009, 12:49:06
 */
package pestañas;

import java.awt.Color;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import javax.swing.JProgressBar;
import javax.swing.JTextField;
import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.MinimalBalloonStyle;
import net.java.balloontip.utils.TimingUtils;
import utilidades.*;
import vistas.VistaPrincipal;

/**
 *
 * @author Shidobu
 */
public class PanelPaso2 extends javax.swing.JPanel {

    VistaPrincipal vista;
    public static JProgressBar barraProgreso;
    float valorUF = (float) 1;//por mientras
    int valorTextField;
    boolean botonUfInternetUsado = false;
    //Cada panel de la pestaña 2 esta dividivo y se le asigna un valor, al comienzo es cero
    static int valorp1 = 0;
    static int valorp2 = 0;
    static int valorp3 = 0;

    //Cada panel de la pestaña 2 esta dividivo y se le asigna un valor, esta funcion actualiza la barra en funcion del valor
    public static void actualizarbarra() {
        int total = valorp1 + valorp2 + valorp3;
        barraProgreso.setValue(total);
    }

    //Actualiza los valores del panel dado, suma o resta al valor del panel
    public static void actualizarpanel(int valor, int panel) {
        switch (panel) {
            case 1: {
                valorp1 += valor;
                break;
            }
            case 2: {
                valorp2 += valor;
                break;
            }
            case 3: {
                valorp3 += valor;
                break;
            }
            default: {
                break;
            }
        }

        actualizarbarra();

    }



    /*
     * MODIFICACION REALIZADA POR EL GRUPO 2
     * Implementación de los listeners para la funcionalidad
     * Deshacer y Rehacer
     */
    //AGREGE DEDE ESTE PUNTO
    private void cargarListener() {
        jTextFieldArriendoOficinaPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });


        jTextFieldGastosAlimentacionPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldGastosBasicosPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldGastosCoffeBreaksPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldGastosMaterialApoyoPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldGastosMovilizacionPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });


        jTextFieldGastosOperacionalesPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldGastosServiciosExternosPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldValorFactorCosto.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });


        jTextFieldValorHHDesarrolladorPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldHorasReparacion.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldValorNumeroDesarrolladores.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldInsumosPesos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });
    }

    /*
     * FIN MODIFICACION DESHACER Y REHACER
     */
    /** Creates new form PanelPaso2 */
    public PanelPaso2() {
        initComponents();
        this.jRadioButton1.setSelected(true);
        this.jRadioButtonHHPesos.setSelected(true);
        this.cargarListener();
    }

    public float getValorUF() {
        return valorUF;
    }

    public void setBarraProgreso(JProgressBar barraProgreso) {
        this.barraProgreso = barraProgreso;
        /*Validar Barra */
        jTextFieldValorUF.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldValorUF,1,2));
        jTextFieldArriendoOficinaPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldArriendoOficinaPesos,2,2));
        jTextFieldGastosOperacionalesPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosOperacionalesPesos,2,2));
        jTextFieldGastosMaterialApoyoPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosMaterialApoyoPesos,2,2));
        jTextFieldInsumosPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldInsumosPesos,2,2));
        jTextFieldGastosBasicosPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosBasicosPesos,2,2));
        jTextFieldGastosMovilizacionPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosMovilizacionPesos,2,2));
        jTextFieldGastosCoffeBreaksPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosCoffeBreaksPesos,2,2));
        jTextFieldGastosAlimentacionPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosAlimentacionPesos,2,2));
        jTextFieldGastosServiciosExternosPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldGastosServiciosExternosPesos,2,2));
        jTextFieldValorFactorCosto.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldValorFactorCosto,2,2));

        jTextFieldHorasReparacion.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldHorasReparacion,3,2));
        jTextFieldValorHHDesarrolladorPesos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldValorHHDesarrolladorPesos,3,2));
        jTextFieldValorNumeroDesarrolladores.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldValorNumeroDesarrolladores,3,2));

        jTextFieldValorUF.addKeyListener(new ValidaUF(jTextFieldValorUF));       
        jTextFieldArriendoOficinaPesos.addKeyListener(new ValidaUF(jTextFieldArriendoOficinaPesos));        
        jTextFieldGastosOperacionalesPesos.addKeyListener(new ValidaUF(jTextFieldGastosOperacionalesPesos));        
        jTextFieldGastosMaterialApoyoPesos.addKeyListener(new ValidaUF(jTextFieldGastosMaterialApoyoPesos));
        jTextFieldInsumosPesos.addKeyListener(new ValidaUF(jTextFieldInsumosPesos));
        jTextFieldGastosBasicosPesos.addKeyListener(new ValidaUF(jTextFieldGastosBasicosPesos));
        jTextFieldGastosMovilizacionPesos.addKeyListener(new ValidaUF(jTextFieldGastosMovilizacionPesos));
        jTextFieldGastosCoffeBreaksPesos.addKeyListener(new ValidaUF(jTextFieldGastosCoffeBreaksPesos));
        jTextFieldGastosAlimentacionPesos.addKeyListener(new ValidaUF(jTextFieldGastosAlimentacionPesos));
        jTextFieldGastosServiciosExternosPesos.addKeyListener(new ValidaUF(jTextFieldGastosServiciosExternosPesos));
        jTextFieldValorFactorCosto.addKeyListener(new ValidaUF(jTextFieldValorFactorCosto));
        jTextFieldHorasReparacion.addKeyListener(new ValidaUF(jTextFieldHorasReparacion));
        jTextFieldValorHHDesarrolladorPesos.addKeyListener(new ValidaUF(jTextFieldValorHHDesarrolladorPesos));
        jTextFieldValorNumeroDesarrolladores.addKeyListener(new ValidaUF(jTextFieldValorNumeroDesarrolladores));



    }

    public void setVista(VistaPrincipal vista) {
        this.vista = vista;
    }

    public void setUF(JTextField jt) {
        if (!(jTextFieldValorUF.getText().equals("")) && !jTextFieldValorUF.getText().equals(".")) {
            try {
                this.valorUF = Float.parseFloat(jt.getText());
            } catch (Exception e) {
                this.valorUF = 1;
            }
        } else {
            if (!jt.getText().equals("")) {
                TimingUtils.showTimedBalloon(new BalloonTip(jTextFieldValorUF, "Si el valor empieza con punto, debe indicar decimales",
                        new MinimalBalloonStyle(new Color(231, 225, 165), 2), BalloonTip.Orientation.LEFT_ABOVE,
                        BalloonTip.AttachLocation.ALIGNED, 20, 10, false), 3000);
            }
        }
    }

    public JProgressBar getBarraProgreso() {
        return barraProgreso;
    }

    public JTextField getJTextFieldArriendoOficinaPesos() {
        return jTextFieldArriendoOficinaPesos;
    }

    public JTextField getJTextFieldArriendoOficinaUF() {
        return jTextFieldArriendoOficinaUF;
    }

    public JTextField getJTextFieldGastosAlimentacionPesos() {
        return jTextFieldGastosAlimentacionPesos;
    }

    public JTextField getJTextFieldGastosAlimentacionUF() {
        return jTextFieldGastosAlimentacionUF;
    }

    public JTextField getJTextFieldGastosBasicosPesos() {
        return jTextFieldGastosBasicosPesos;
    }

    public JTextField getJTextFieldGastosBasicosUF() {
        return jTextFieldGastosBasicosUF;
    }

    public JTextField getJTextFieldGastosCoffeBreaksPesos() {
        return jTextFieldGastosCoffeBreaksPesos;
    }

    public JTextField getJTextFieldGastosCoffeBreaksUF() {
        return jTextFieldGastosCoffeBreaksUF;
    }

    public JTextField getJTextFieldGastosMaterialApoyoPesos() {
        return jTextFieldGastosMaterialApoyoPesos;
    }

    public JTextField getJTextFieldGastosMaterialApoyoUF() {
        return jTextFieldGastosMaterialApoyoUF;
    }

    public JTextField getJTextFieldGastosMovilizacionPesos() {
        return jTextFieldGastosMovilizacionPesos;
    }

    public JTextField getJTextFieldGastosMovilizacionUF() {
        return jTextFieldGastosMovilizacionUF;
    }

    public JTextField getJTextFieldGastosOperacionalesPesos() {
        return jTextFieldGastosOperacionalesPesos;
    }

    public JTextField getJTextFieldGastosOperacionalesUF() {
        return jTextFieldGastosOperacionalesUF;
    }

    public JTextField getJTextFieldGastosServiciosExternosPesos() {
        return jTextFieldGastosServiciosExternosPesos;
    }

    public JTextField getJTextFieldGastosServiciosExternosUF() {
        return jTextFieldGastosServiciosExternosUF;
    }

    public JTextField getJTextFieldGastosTotalPesos() {
        return jTextFieldGastosTotalPesos;
    }

    public JTextField getJTextFieldGastosTotalUF() {
        return jTextFieldGastosTotalUF;
    }

    public JTextField getJTextFieldHorasReparacion() {
        return jTextFieldHorasReparacion;
    }

    public JTextField getJTextFieldInsumosPesos() {
        return jTextFieldInsumosPesos;
    }

    public JTextField getJTextFieldInsumosUF() {
        return jTextFieldInsumosUF;
    }

    public JTextField getJTextFieldTotalCostoPesos() {
        return jTextFieldTotalCostoPesos;
    }

    public JTextField getJTextFieldTotalCostoUF() {
        return jTextFieldTotalCostoUF;
    }

    public JTextField getJTextFieldValorFactorCosto() {
        return jTextFieldValorFactorCosto;
    }

    public JTextField getJTextFieldValorHHDesarrolladorPesos() {
        return jTextFieldValorHHDesarrolladorPesos;
    }

    public JTextField getJTextFieldValorHHDesarrolladorUF() {
        return jTextFieldValorHHDesarrolladorUF;
    }

    public JTextField getJTextFieldValorNumeroDesarrolladores() {
        return jTextFieldValorNumeroDesarrolladores;
    }

    public JTextField getJTextFieldValorUF() {
        return jTextFieldValorUF;
    }

    public void calculaUF(JTextField jTFPESOS, JTextField jTFUF) {
        if (!(jTFPESOS.getText().equals(""))) {
            if (jTFPESOS.getText().matches("[0-9]*")) {
                valorTextField = Integer.parseInt(jTFPESOS.getText());
                float resultadoUF = ValidaDecimal.roundNum(((float) valorTextField) / valorUF);
                jTFUF.setText(String.valueOf(resultadoUF));
            }
        } else //Si el valor de gasto en pesos es nulo, se setea el valor del UF correspondiente
        {
            jTFUF.setText("");
        }

        sumaTotal();// Se calcula la suma total de los gastos tanto en Pesos como en UF


    }

    public void calculaPeso(JTextField jTFPESOS, JTextField jTFUF) {
        if (!(jTFUF.getText().equals(""))) {
            if (jTFUF.getText().matches("[0-9]*")) {
                valorTextField = Integer.parseInt(jTFUF.getText());
                float resultadoPESOS = ValidaDecimal.roundNum(((float) valorTextField) * valorUF);
                jTFPESOS.setText(String.valueOf(resultadoPESOS));
            }
        } else //Si el valor de gasto en pesos es nulo, se setea el valor del UF correspondiente
        {
            jTFPESOS.setText("");
        }

        sumaTotal();// Se calcula la suma total de los gastos tanto en Pesos como en UF
    }

    public void calculaUFes() {
        this.calculaUF(jTextFieldArriendoOficinaPesos, jTextFieldArriendoOficinaUF);
        this.calculaUF(jTextFieldGastosOperacionalesPesos, jTextFieldGastosOperacionalesUF);
        this.calculaUF(jTextFieldGastosMaterialApoyoPesos, jTextFieldGastosMaterialApoyoUF);
        this.calculaUF(jTextFieldInsumosPesos, jTextFieldInsumosUF);
        this.calculaUF(jTextFieldGastosBasicosPesos, jTextFieldGastosBasicosUF);
        this.calculaUF(jTextFieldGastosMovilizacionPesos, jTextFieldGastosMovilizacionUF);
        this.calculaUF(jTextFieldGastosCoffeBreaksPesos, jTextFieldGastosCoffeBreaksUF);
        this.calculaUF(jTextFieldGastosAlimentacionPesos, jTextFieldGastosAlimentacionUF);
        this.calculaUF(jTextFieldGastosServiciosExternosPesos, jTextFieldGastosServiciosExternosUF);
        this.calculaUF(jTextFieldValorHHDesarrolladorPesos, jTextFieldValorHHDesarrolladorUF);

    }

    public void calculaPesos() {
        this.calculaPeso(jTextFieldArriendoOficinaPesos, jTextFieldArriendoOficinaUF);
        this.calculaPeso(jTextFieldGastosOperacionalesPesos, jTextFieldGastosOperacionalesUF);
        this.calculaPeso(jTextFieldGastosMaterialApoyoPesos, jTextFieldGastosMaterialApoyoUF);
        this.calculaPeso(jTextFieldInsumosPesos, jTextFieldInsumosUF);
        this.calculaPeso(jTextFieldGastosBasicosPesos, jTextFieldGastosBasicosUF);
        this.calculaPeso(jTextFieldGastosMovilizacionPesos, jTextFieldGastosMovilizacionUF);
        this.calculaPeso(jTextFieldGastosCoffeBreaksPesos, jTextFieldGastosCoffeBreaksUF);
        this.calculaPeso(jTextFieldGastosAlimentacionPesos, jTextFieldGastosAlimentacionUF);
        this.calculaPeso(jTextFieldGastosServiciosExternosPesos, jTextFieldGastosServiciosExternosUF);
        this.calculaPeso(jTextFieldValorHHDesarrolladorPesos, jTextFieldValorHHDesarrolladorUF);

    }

    public void sumaTotal() {
        int totalPesos = 0;//variable que almacena la suma total en PESOS
        float totalUF = 0; //variable que almacena la suma total en UF

        /*A continuacion se verifican los jtextField correspondiente al gasto en PESOS y se suma si es que el valor no es nulo*/
        if (!(jTextFieldArriendoOficinaPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldArriendoOficinaPesos.getText());
        }

        if (!(jTextFieldGastosOperacionalesPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosOperacionalesPesos.getText());
        }

        if (!(jTextFieldGastosMaterialApoyoPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosMaterialApoyoPesos.getText());
        }

        if (!(jTextFieldInsumosPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldInsumosPesos.getText());
        }

        if (!(jTextFieldGastosBasicosPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosBasicosPesos.getText());
        }

        if (!(jTextFieldGastosMovilizacionPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosMovilizacionPesos.getText());
        }

        if (!(jTextFieldGastosCoffeBreaksPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosCoffeBreaksPesos.getText());
        }

        if (!(jTextFieldGastosAlimentacionPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosAlimentacionPesos.getText());
        }

        if (!(jTextFieldGastosServiciosExternosPesos.getText()).equals("")) {
            totalPesos = totalPesos + Integer.parseInt(jTextFieldGastosServiciosExternosPesos.getText());
        }

        /*A continuacion se verifican los jtextField correspondiente al gasto en UF y se suma si es que el valor no es nulo*/

        if (!(jTextFieldArriendoOficinaUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldArriendoOficinaUF.getText());
        }

        if (!(jTextFieldGastosOperacionalesUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosOperacionalesUF.getText());
        }

        if (!(jTextFieldGastosMaterialApoyoUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosMaterialApoyoUF.getText());
        }

        if (!(jTextFieldInsumosUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldInsumosUF.getText());
        }

        if (!(jTextFieldGastosBasicosUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosBasicosUF.getText());
        }

        if (!(jTextFieldGastosMovilizacionUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosMovilizacionUF.getText());
        }

        if (!(jTextFieldGastosCoffeBreaksUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosCoffeBreaksUF.getText());
        }

        if (!(jTextFieldGastosAlimentacionUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosAlimentacionUF.getText());
        }

        if (!(jTextFieldGastosServiciosExternosUF.getText()).equals("")) {
            totalUF = totalUF + Float.parseFloat(jTextFieldGastosServiciosExternosUF.getText());
        }


        /* Se ingresan los resultados a los jtextfield del TOTAL*/

        jTextFieldGastosTotalPesos.setText(String.valueOf(totalPesos));
        jTextFieldGastosTotalUF.setText(String.valueOf(ValidaDecimal.roundNum(totalUF)));

        /* Se calcula el costo total para el factor costo*/
        if (totalPesos != 0 && !jTextFieldValorFactorCosto.getText().isEmpty()) {
            float totalPeso = Integer.parseInt(jTextFieldGastosTotalPesos.getText()) * (Float.parseFloat(jTextFieldValorFactorCosto.getText()) / 100);
            int totalP = (int) totalPeso;
            jTextFieldTotalCostoPesos.setText(String.valueOf(totalP));

            valorTextField = Integer.parseInt(jTextFieldTotalCostoPesos.getText());
            float resultadoUF = ValidaDecimal.roundNum(((float) valorTextField) / valorUF);
            jTextFieldTotalCostoUF.setText(String.valueOf(resultadoUF));
        }

    }

////////////////Para guardar en el Archivo//////////////////////////////////////
    public String retornaArriendo() {
        String Arriendo, enPesos, enUF;
        enPesos = jTextFieldArriendoOficinaPesos.getText().toString();
        enUF = jTextFieldArriendoOficinaUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        Arriendo = enPesos + "#" + enUF;
        return Arriendo;
    }

    public String retornaGastosOP() {
        String GastosOP, enPesos, enUF;
        enPesos = jTextFieldGastosOperacionalesPesos.getText().toString();
        enUF = jTextFieldGastosOperacionalesUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosOP = enPesos + "#" + enUF;
        return GastosOP;

    }

    public String retornaGastosMA() {
        String GastosMA, enPesos, enUF;
        enPesos = jTextFieldGastosMaterialApoyoPesos.getText().toString();
        enUF = jTextFieldGastosMaterialApoyoUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosMA = enPesos + "#" + enUF;
        return GastosMA;
    }

    public String retornaInsumos() {
        String Insumos, enPesos, enUF;
        enPesos = jTextFieldInsumosPesos.getText().toString();
        enUF = jTextFieldInsumosUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        Insumos = enPesos + "#" + enUF;
        return Insumos;
    }

    public String retornaGastosB() {
        String GastosB, enPesos, enUF;
        enPesos = jTextFieldGastosBasicosPesos.getText().toString();
        enUF = jTextFieldGastosBasicosUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosB = enPesos + "#" + enUF;
        return GastosB;
    }

    public String retornaGastosMov() {
        String GastosMov, enPesos, enUF;
        enPesos = jTextFieldGastosMovilizacionPesos.getText().toString();
        enUF = jTextFieldGastosMovilizacionUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosMov = enPesos + "#" + enUF;
        return GastosMov;
    }

    public String retornaGastosCoffe() {
        String GastosCoffe, enPesos, enUF;
        enPesos = jTextFieldGastosCoffeBreaksPesos.getText().toString();
        enUF = jTextFieldGastosCoffeBreaksUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosCoffe = enPesos + "#" + enUF;
        return GastosCoffe;
    }

    public String retornaGastosAlim() {
        String GastosAlim, enPesos, enUF;
        enPesos = jTextFieldGastosAlimentacionPesos.getText().toString();
        enUF = jTextFieldGastosAlimentacionUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        GastosAlim = enPesos + "#" + enUF;
        return GastosAlim;
    }

    public String retornaServExt() {
        String ServExt, enPesos, enUF;
        enPesos = jTextFieldGastosServiciosExternosPesos.getText().toString();
        enUF = jTextFieldGastosServiciosExternosUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        ServExt = enPesos + "#" + enUF;
        return ServExt;
    }

    public String retornaTotalGastos() {
        String TotalGastos, enPesos, enUF;
        enPesos = jTextFieldGastosTotalPesos.getText().toString();
        enUF = jTextFieldGastosTotalUF.getText().toString();
        if (enPesos.equals("")) {
            enPesos = "-1";
        }
        if (enUF.equals("")) {
            enUF = "-1";
        }
        TotalGastos = enPesos + "#" + enUF;
        return TotalGastos;
    }

    public String retornaFaseRep() {
        String FaseRep, Horas, Desarrolladores, ValorHHenPesos, ValorHHenUF;
        Horas = jTextFieldHorasReparacion.getText().toString();
        Desarrolladores = jTextFieldValorNumeroDesarrolladores.getText().toString();
        ValorHHenPesos = jTextFieldValorHHDesarrolladorPesos.getText().toString();
        ValorHHenUF = jTextFieldValorHHDesarrolladorUF.getText().toString();

        if (Horas.equals("")) {
            Horas = "-1";
        }
        if (Desarrolladores.equals("")) {
            Desarrolladores = "-1";
        }
        if (ValorHHenPesos.equals("")) {
            ValorHHenPesos = "-1";
        }
        if (ValorHHenUF.equals("")) {
            ValorHHenUF = "-1";
        }
        FaseRep = Horas + "#" + Desarrolladores + "#" + ValorHHenPesos + "#" + ValorHHenUF;
        return FaseRep;
    }

    public String retornaCostos() {
        String CostoTotal, Factor, TotalenPesos, TotalenUF;

        Factor = jTextFieldValorFactorCosto.getText().toString();
        TotalenPesos = jTextFieldTotalCostoPesos.getText().toString();
        TotalenUF = jTextFieldTotalCostoUF.getText().toString();
        if (Factor.equals("")) {
            Factor = "-1";
        }
        if (TotalenPesos.equals("")) {
            TotalenPesos = "-1";
        }
        if (TotalenUF.equals("")) {
            TotalenUF = "-1";
        }

        CostoTotal = Factor + "#" + TotalenPesos + "#" + TotalenUF;
        return CostoTotal;
    }
////////////////////////////////////////////////////////////////////////////////

    //Métodos para ABRIR y para LIMPIAR
    public void setValorUF(String valor) {
        this.jTextFieldValorUF.setText(valor);
    }

    public void setHorasReparacion(String valor) {
        this.jTextFieldHorasReparacion.setText(valor);
    }

    public void setValorNumeroDesarrolladores(String valor) {
        this.jTextFieldValorNumeroDesarrolladores.setText(valor);
    }

    public void setValorHHDesarrolladorPesos(String valor) {
        this.jTextFieldValorHHDesarrolladorPesos.setText(valor);
    }

    public void setValorHHDesarrolladorUF(String valor) {
        this.jTextFieldValorHHDesarrolladorUF.setText(valor);
    }

    public void setArriendoOficinaPesos(String valor) {
        this.jTextFieldArriendoOficinaPesos.setText(valor);
    }

    public void setArriendoOficinaUF(String valor) {
        this.jTextFieldArriendoOficinaUF.setText(valor);
    }

    public void setGastosOperacionalesPesos(String valor) {
        this.jTextFieldGastosOperacionalesPesos.setText(valor);
    }

    public void setGastosOperacionalesUF(String valor) {
        this.jTextFieldGastosOperacionalesUF.setText(valor);
    }

    public void setGastosMaterialApoyoPesos(String valor) {
        this.jTextFieldGastosMaterialApoyoPesos.setText(valor);
    }

    public void setGastosMaterialApoyoUF(String valor) {
        this.jTextFieldGastosMaterialApoyoUF.setText(valor);
    }

    public void setInsumosPesos(String valor) {
        this.jTextFieldInsumosPesos.setText(valor);
    }

    public void setInsumosUF(String valor) {
        this.jTextFieldInsumosUF.setText(valor);
    }

    public void setGastosBasicosPesos(String valor) {
        this.jTextFieldGastosBasicosPesos.setText(valor);
    }

    public void setGastosBasicosUF(String valor) {
        this.jTextFieldGastosBasicosUF.setText(valor);
    }

    public void setGastosMovilizacionPesos(String valor) {
        this.jTextFieldGastosMovilizacionPesos.setText(valor);
    }

    public void setGastosMovilizacionUF(String valor) {
        this.jTextFieldGastosMovilizacionUF.setText(valor);
    }

    public void setGastosCoffeBreaksPesos(String valor) {
        this.jTextFieldGastosCoffeBreaksPesos.setText(valor);
    }

    public void setGastosCoffeBreaksUF(String valor) {
        this.jTextFieldGastosCoffeBreaksUF.setText(valor);
    }

    public void setGastosAlimentacionPesos(String valor) {
        this.jTextFieldGastosAlimentacionPesos.setText(valor);
    }

    public void setGastosAlimentacionUF(String valor) {
        this.jTextFieldGastosAlimentacionUF.setText(valor);
    }

    public void setGastosServiciosExternosPesos(String valor) {
        this.jTextFieldGastosServiciosExternosPesos.setText(valor);
    }

    public void setGastosServiciosExternosUF(String valor) {
        this.jTextFieldGastosServiciosExternosUF.setText(valor);
    }

    public void setGastosTotalPesos(String valor) {
        this.jTextFieldGastosTotalPesos.setText(valor);
    }

    public void setGastosTotalUF(String valor) {
        this.jTextFieldGastosTotalUF.setText(valor);
    }

    public void setValorFactorCosto(String valor) {
        this.jTextFieldValorFactorCosto.setText(valor);
    }

    public void setTotalCostoPesos(String valor) {
        this.jTextFieldTotalCostoPesos.setText(valor);
    }

    public void setTotalCostoUF(String valor) {
        this.jTextFieldTotalCostoUF.setText(valor);
    }

    public JTextField getjTextFieldArriendoOficinaPesos() {
        return jTextFieldArriendoOficinaPesos;
    }

    public JTextField getjTextFieldArriendoOficinaUF() {
        return jTextFieldArriendoOficinaUF;
    }

    public JTextField getjTextFieldGastosAlimentacionPesos() {
        return jTextFieldGastosAlimentacionPesos;
    }

    public JTextField getjTextFieldGastosAlimentacionUF() {
        return jTextFieldGastosAlimentacionUF;
    }

    public JTextField getjTextFieldGastosBasicosPesos() {
        return jTextFieldGastosBasicosPesos;
    }

    public JTextField getjTextFieldGastosBasicosUF() {
        return jTextFieldGastosBasicosUF;
    }

    public JTextField getjTextFieldGastosCoffeBreaksPesos() {
        return jTextFieldGastosCoffeBreaksPesos;
    }

    public JTextField getjTextFieldGastosCoffeBreaksUF() {
        return jTextFieldGastosCoffeBreaksUF;
    }

    public JTextField getjTextFieldGastosMaterialApoyoPesos() {
        return jTextFieldGastosMaterialApoyoPesos;
    }

    public JTextField getjTextFieldGastosMaterialApoyoUF() {
        return jTextFieldGastosMaterialApoyoUF;
    }

    public JTextField getjTextFieldGastosMovilizacionPesos() {
        return jTextFieldGastosMovilizacionPesos;
    }

    public JTextField getjTextFieldGastosMovilizacionUF() {
        return jTextFieldGastosMovilizacionUF;
    }

    public JTextField getjTextFieldGastosOperacionalesPesos() {
        return jTextFieldGastosOperacionalesPesos;
    }

    public JTextField getjTextFieldGastosOperacionalesUF() {
        return jTextFieldGastosOperacionalesUF;
    }

    public JTextField getjTextFieldGastosServiciosExternosPesos() {
        return jTextFieldGastosServiciosExternosPesos;
    }

    public JTextField getjTextFieldGastosServiciosExternosUF() {
        return jTextFieldGastosServiciosExternosUF;
    }

    public JTextField getjTextFieldGastosTotalPesos() {
        return jTextFieldGastosTotalPesos;
    }

    public JTextField getjTextFieldGastosTotalUF() {
        return jTextFieldGastosTotalUF;
    }

    public JTextField getjTextFieldHorasReparacion() {
        return jTextFieldHorasReparacion;
    }

    public JTextField getjTextFieldInsumosPesos() {
        return jTextFieldInsumosPesos;
    }

    public JTextField getjTextFieldInsumosUF() {
        return jTextFieldInsumosUF;
    }

    public JTextField getjTextFieldTotalCostoPesos() {
        return jTextFieldTotalCostoPesos;
    }

    public JTextField getjTextFieldTotalCostoUF() {
        return jTextFieldTotalCostoUF;
    }

    public JTextField getjTextFieldValorFactorCosto() {
        return jTextFieldValorFactorCosto;
    }

    public JTextField getjTextFieldValorHHDesarrolladorPesos() {
        return jTextFieldValorHHDesarrolladorPesos;
    }

    public JTextField getjTextFieldValorHHDesarrolladorUF() {
        return jTextFieldValorHHDesarrolladorUF;
    }

    public JTextField getjTextFieldValorNumeroDesarrolladores() {
        return jTextFieldValorNumeroDesarrolladores;
    }

    public JTextField getjTextFieldValorUF() {
        return jTextFieldValorUF;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelValorUF = new javax.swing.JPanel();
        jLabelIngresoValorUF = new javax.swing.JLabel();
        jTextFieldValorUF = new javax.swing.JTextField();
        jButtonValorUfInternet = new javax.swing.JButton();
        jPanelCostosDiseñoEvaluacionAnalisis = new javax.swing.JPanel();
        jPanelFactorCosto = new javax.swing.JPanel();
        jLabelFactorCosto = new javax.swing.JLabel();
        jTextFieldValorFactorCosto = new javax.swing.JTextField();
        jPanelTotalCosto = new javax.swing.JPanel();
        jLabelTotalCostoPesos = new javax.swing.JLabel();
        jLabelTotalCostosUF = new javax.swing.JLabel();
        jTextFieldTotalCostoPesos = new javax.swing.JTextField();
        jTextFieldTotalCostoUF = new javax.swing.JTextField();
        jPanelGastoItems = new javax.swing.JPanel();
        jLabelArriendoOficina = new javax.swing.JLabel();
        jLabelGastosMaterialApoyo = new javax.swing.JLabel();
        jLabelInsumos = new javax.swing.JLabel();
        jLabelGastosMovilizacion = new javax.swing.JLabel();
        jLabelGastosCoffeBreaks = new javax.swing.JLabel();
        jLabelGastosBasicos = new javax.swing.JLabel();
        jLabelGastosAlimentacion = new javax.swing.JLabel();
        jLabelGastosServiciosExternos = new javax.swing.JLabel();
        jLabelTotalGastos = new javax.swing.JLabel();
        jTextFieldArriendoOficinaPesos = new javax.swing.JTextField();
        jTextFieldArriendoOficinaUF = new javax.swing.JTextField();
        jTextFieldGastosOperacionalesUF = new javax.swing.JTextField();
        jTextFieldGastosOperacionalesPesos = new javax.swing.JTextField();
        jTextFieldGastosMaterialApoyoUF = new javax.swing.JTextField();
        jTextFieldGastosMaterialApoyoPesos = new javax.swing.JTextField();
        jTextFieldInsumosUF = new javax.swing.JTextField();
        jTextFieldInsumosPesos = new javax.swing.JTextField();
        jTextFieldGastosBasicosUF = new javax.swing.JTextField();
        jTextFieldGastosBasicosPesos = new javax.swing.JTextField();
        jTextFieldGastosMovilizacionUF = new javax.swing.JTextField();
        jTextFieldGastosMovilizacionPesos = new javax.swing.JTextField();
        jTextFieldGastosCoffeBreaksPesos = new javax.swing.JTextField();
        jTextFieldGastosCoffeBreaksUF = new javax.swing.JTextField();
        jTextFieldGastosAlimentacionPesos = new javax.swing.JTextField();
        jTextFieldGastosAlimentacionUF = new javax.swing.JTextField();
        jTextFieldGastosServiciosExternosPesos = new javax.swing.JTextField();
        jTextFieldGastosServiciosExternosUF = new javax.swing.JTextField();
        jTextFieldGastosTotalPesos = new javax.swing.JTextField();
        jTextFieldGastosTotalUF = new javax.swing.JTextField();
        jLabelGastosOperacionales = new javax.swing.JLabel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jPanelCostosReparacion = new javax.swing.JPanel();
        jPanelCantidad = new javax.swing.JPanel();
        jLabelHorasReparacion = new javax.swing.JLabel();
        jLabelNumeroDesarrolladores = new javax.swing.JLabel();
        jTextFieldHorasReparacion = new javax.swing.JTextField();
        jTextFieldValorNumeroDesarrolladores = new javax.swing.JTextField();
        jPanelDesarrollador = new javax.swing.JPanel();
        jTextFieldValorHHDesarrolladorPesos = new javax.swing.JTextField();
        jTextFieldValorHHDesarrolladorUF = new javax.swing.JTextField();
        jRadioButtonHHPesos = new javax.swing.JRadioButton();
        jRadioButtonHHUf = new javax.swing.JRadioButton();

        setMaximumSize(new java.awt.Dimension(595, 540));
        setMinimumSize(new java.awt.Dimension(595, 540));
        setPreferredSize(new java.awt.Dimension(595, 540));

        jPanelValorUF.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabelIngresoValorUF.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabelIngresoValorUF.setText("Ingrese el valor de la UF:");

        jTextFieldValorUF.setToolTipText("Ingrese un valor positivo, utilizando punto para los decimales");
        jTextFieldValorUF.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldValorUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldValorUFKeyReleased(evt);
            }
        });

        jButtonValorUfInternet.setText("Obtener valor UF vía internet");
        jButtonValorUfInternet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonValorUfInternetActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelValorUFLayout = new javax.swing.GroupLayout(jPanelValorUF);
        jPanelValorUF.setLayout(jPanelValorUFLayout);
        jPanelValorUFLayout.setHorizontalGroup(
            jPanelValorUFLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelValorUFLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelIngresoValorUF)
                .addGap(18, 18, 18)
                .addComponent(jTextFieldValorUF, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButtonValorUfInternet, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(131, Short.MAX_VALUE))
        );
        jPanelValorUFLayout.setVerticalGroup(
            jPanelValorUFLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelValorUFLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelValorUFLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelIngresoValorUF)
                    .addComponent(jTextFieldValorUF, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonValorUfInternet))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelCostosDiseñoEvaluacionAnalisis.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Costos Fase de Diseño, Evaluación y Análisis", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N
        jPanelCostosDiseñoEvaluacionAnalisis.setPreferredSize(new java.awt.Dimension(3125, 364));

        jLabelFactorCosto.setText("Factor Costo (%):");

        jTextFieldValorFactorCosto.setToolTipText("Ingrese un número entre 0 y 100");
        jTextFieldValorFactorCosto.setPreferredSize(new java.awt.Dimension(90, 20));
        jTextFieldValorFactorCosto.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldValorFactorCostoKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanelFactorCostoLayout = new javax.swing.GroupLayout(jPanelFactorCosto);
        jPanelFactorCosto.setLayout(jPanelFactorCostoLayout);
        jPanelFactorCostoLayout.setHorizontalGroup(
            jPanelFactorCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelFactorCostoLayout.createSequentialGroup()
                .addContainerGap(14, Short.MAX_VALUE)
                .addComponent(jLabelFactorCosto)
                .addComponent(jTextFieldValorFactorCosto, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanelFactorCostoLayout.setVerticalGroup(
            jPanelFactorCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFactorCostoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelFactorCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldValorFactorCosto, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelFactorCosto))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanelTotalCosto.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Total Costo"));

        jLabelTotalCostoPesos.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostoPesos.setText("En Pesos ($)");
        jLabelTotalCostoPesos.setMaximumSize(new java.awt.Dimension(80, 14));
        jLabelTotalCostoPesos.setMinimumSize(new java.awt.Dimension(80, 14));
        jLabelTotalCostoPesos.setPreferredSize(new java.awt.Dimension(80, 14));

        jLabelTotalCostosUF.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTotalCostosUF.setText("En UF");
        jLabelTotalCostosUF.setMaximumSize(new java.awt.Dimension(80, 14));
        jLabelTotalCostosUF.setMinimumSize(new java.awt.Dimension(80, 14));
        jLabelTotalCostosUF.setPreferredSize(new java.awt.Dimension(80, 14));

        jTextFieldTotalCostoPesos.setEnabled(false);
        jTextFieldTotalCostoPesos.setMinimumSize(new java.awt.Dimension(80, 14));
        jTextFieldTotalCostoPesos.setPreferredSize(new java.awt.Dimension(80, 20));

        jTextFieldTotalCostoUF.setEnabled(false);
        jTextFieldTotalCostoUF.setMaximumSize(new java.awt.Dimension(80, 14));
        jTextFieldTotalCostoUF.setMinimumSize(new java.awt.Dimension(80, 14));
        jTextFieldTotalCostoUF.setPreferredSize(new java.awt.Dimension(80, 20));

        javax.swing.GroupLayout jPanelTotalCostoLayout = new javax.swing.GroupLayout(jPanelTotalCosto);
        jPanelTotalCosto.setLayout(jPanelTotalCostoLayout);
        jPanelTotalCostoLayout.setHorizontalGroup(
            jPanelTotalCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTotalCostoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTotalCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldTotalCostoPesos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelTotalCostoPesos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelTotalCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelTotalCostosUF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldTotalCostoUF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelTotalCostoLayout.setVerticalGroup(
            jPanelTotalCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelTotalCostoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTotalCostoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelTotalCostoLayout.createSequentialGroup()
                        .addComponent(jLabelTotalCostosUF, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                        .addComponent(jTextFieldTotalCostoUF, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelTotalCostoLayout.createSequentialGroup()
                        .addComponent(jLabelTotalCostoPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                        .addComponent(jTextFieldTotalCostoPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanelGastoItems.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Gasto por ítem"));
        jPanelGastoItems.setMaximumSize(new java.awt.Dimension(300, 310));
        jPanelGastoItems.setMinimumSize(new java.awt.Dimension(300, 310));
        jPanelGastoItems.setPreferredSize(new java.awt.Dimension(300, 310));

        jLabelArriendoOficina.setText("Arriendo de Oficina:");
        jLabelArriendoOficina.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelArriendoOficina.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelArriendoOficina.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosMaterialApoyo.setText("Material de Apoyo:");
        jLabelGastosMaterialApoyo.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosMaterialApoyo.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosMaterialApoyo.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelInsumos.setText("Insumos");
        jLabelInsumos.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelInsumos.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelInsumos.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosMovilizacion.setText("Gastos por Movilización:");
        jLabelGastosMovilizacion.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosMovilizacion.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosMovilizacion.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosCoffeBreaks.setText("Gastos por Coffe Breaks:");
        jLabelGastosCoffeBreaks.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosCoffeBreaks.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosCoffeBreaks.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosBasicos.setText("Gastos Básicos");
        jLabelGastosBasicos.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosBasicos.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosBasicos.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosAlimentacion.setText("Gastos por Alimentación:");
        jLabelGastosAlimentacion.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosAlimentacion.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosAlimentacion.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelGastosServiciosExternos.setText("Gastos Servicios Externos:");
        jLabelGastosServiciosExternos.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosServiciosExternos.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosServiciosExternos.setPreferredSize(new java.awt.Dimension(135, 14));

        jLabelTotalGastos.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelTotalGastos.setText("TOTAL:   ");
        jLabelTotalGastos.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelTotalGastos.setPreferredSize(new java.awt.Dimension(135, 14));

        jTextFieldArriendoOficinaPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldArriendoOficinaPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldArriendoOficinaPesosKeyReleased(evt);
            }
        });

        jTextFieldArriendoOficinaUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldArriendoOficinaUF.setEnabled(false);
        jTextFieldArriendoOficinaUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldArriendoOficinaUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldArriendoOficinaUFKeyReleased(evt);
            }
        });

        jTextFieldGastosOperacionalesUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosOperacionalesUF.setEnabled(false);
        jTextFieldGastosOperacionalesUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosOperacionalesUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosOperacionalesUFKeyReleased(evt);
            }
        });

        jTextFieldGastosOperacionalesPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosOperacionalesPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosOperacionalesPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosOperacionalesPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosMaterialApoyoUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosMaterialApoyoUF.setEnabled(false);
        jTextFieldGastosMaterialApoyoUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosMaterialApoyoUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosMaterialApoyoUFKeyReleased(evt);
            }
        });

        jTextFieldGastosMaterialApoyoPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosMaterialApoyoPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosMaterialApoyoPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosMaterialApoyoPesosKeyReleased(evt);
            }
        });

        jTextFieldInsumosUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldInsumosUF.setEnabled(false);
        jTextFieldInsumosUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldInsumosUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldInsumosUFKeyReleased(evt);
            }
        });

        jTextFieldInsumosPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldInsumosPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldInsumosPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldInsumosPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosBasicosUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosBasicosUF.setEnabled(false);
        jTextFieldGastosBasicosUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosBasicosUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosBasicosUFKeyReleased(evt);
            }
        });

        jTextFieldGastosBasicosPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosBasicosPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosBasicosPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosBasicosPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosMovilizacionUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosMovilizacionUF.setEnabled(false);
        jTextFieldGastosMovilizacionUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosMovilizacionUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosMovilizacionUFKeyReleased(evt);
            }
        });

        jTextFieldGastosMovilizacionPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosMovilizacionPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosMovilizacionPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosMovilizacionPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosCoffeBreaksPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosCoffeBreaksPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosCoffeBreaksPesos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldGastosCoffeBreaksPesosActionPerformed(evt);
            }
        });
        jTextFieldGastosCoffeBreaksPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosCoffeBreaksPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosCoffeBreaksUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosCoffeBreaksUF.setEnabled(false);
        jTextFieldGastosCoffeBreaksUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosCoffeBreaksUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosCoffeBreaksUFKeyReleased(evt);
            }
        });

        jTextFieldGastosAlimentacionPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosAlimentacionPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosAlimentacionPesos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldGastosAlimentacionPesosActionPerformed(evt);
            }
        });
        jTextFieldGastosAlimentacionPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosAlimentacionPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosAlimentacionUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosAlimentacionUF.setEnabled(false);
        jTextFieldGastosAlimentacionUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosAlimentacionUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosAlimentacionUFKeyReleased(evt);
            }
        });

        jTextFieldGastosServiciosExternosPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosServiciosExternosPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosServiciosExternosPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosServiciosExternosPesosKeyReleased(evt);
            }
        });

        jTextFieldGastosServiciosExternosUF.setToolTipText("Ingrese un número entero positivo");
        jTextFieldGastosServiciosExternosUF.setEnabled(false);
        jTextFieldGastosServiciosExternosUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosServiciosExternosUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldGastosServiciosExternosUFKeyReleased(evt);
            }
        });

        jTextFieldGastosTotalPesos.setToolTipText("");
        jTextFieldGastosTotalPesos.setEnabled(false);
        jTextFieldGastosTotalPesos.setPreferredSize(new java.awt.Dimension(80, 20));

        jTextFieldGastosTotalUF.setEnabled(false);
        jTextFieldGastosTotalUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldGastosTotalUF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldGastosTotalUFActionPerformed(evt);
            }
        });

        jLabelGastosOperacionales.setText("Gastos Operacionales:");
        jLabelGastosOperacionales.setMaximumSize(new java.awt.Dimension(135, 14));
        jLabelGastosOperacionales.setMinimumSize(new java.awt.Dimension(135, 14));
        jLabelGastosOperacionales.setPreferredSize(new java.awt.Dimension(135, 14));

        jRadioButton1.setText("Pesos ($)");
        jRadioButton1.setToolTipText("Seleccione para ingresar valores en pesos($)");
        jRadioButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jRadioButton1MouseClicked(evt);
            }
        });
        jRadioButton1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jRadioButton1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jRadioButton1KeyReleased(evt);
            }
        });

        jRadioButton2.setText("U.F.");
        jRadioButton2.setToolTipText("Seleccione para ingresar valores en UF");
        jRadioButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jRadioButton2MouseClicked(evt);
            }
        });
        jRadioButton2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jRadioButton2KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jRadioButton2KeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanelGastoItemsLayout = new javax.swing.GroupLayout(jPanelGastoItems);
        jPanelGastoItems.setLayout(jPanelGastoItemsLayout);
        jPanelGastoItemsLayout.setHorizontalGroup(
            jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGastoItemsLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelArriendoOficina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosAlimentacion, 0, 0, Short.MAX_VALUE)
                    .addComponent(jLabelGastosCoffeBreaks, 0, 0, Short.MAX_VALUE)
                    .addComponent(jLabelInsumos, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosMaterialApoyo, 0, 0, Short.MAX_VALUE)
                    .addComponent(jLabelGastosBasicos, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosServiciosExternos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosOperacionales, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosMovilizacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalGastos, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelGastoItemsLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldGastosOperacionalesPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosServiciosExternosPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosBasicosPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosMaterialApoyoPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosAlimentacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosCoffeBreaksPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosMovilizacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGastosTotalPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelGastoItemsLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextFieldArriendoOficinaPesos, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                            .addComponent(jTextFieldInsumosPesos, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                            .addComponent(jRadioButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jRadioButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosTotalUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosMovilizacionUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosOperacionalesUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosAlimentacionUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldArriendoOficinaUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosCoffeBreaksUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldInsumosUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosMaterialApoyoUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosBasicosUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldGastosServiciosExternosUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(34, 34, 34))
        );
        jPanelGastoItemsLayout.setVerticalGroup(
            jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGastoItemsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton2)
                    .addComponent(jRadioButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldArriendoOficinaPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldArriendoOficinaUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelArriendoOficina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldInsumosUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldInsumosPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelInsumos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosCoffeBreaksPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosCoffeBreaksUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosCoffeBreaks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosAlimentacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosAlimentacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosAlimentacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosMaterialApoyoPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosMaterialApoyoUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosMaterialApoyo, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosBasicosPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosBasicosUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosBasicos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosServiciosExternosPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosServiciosExternosUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosServiciosExternos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosOperacionalesPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosOperacionalesUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosOperacionales, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosMovilizacionPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosMovilizacionUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelGastosMovilizacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGastoItemsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGastosTotalPesos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldGastosTotalUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTotalGastos, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanelCostosDiseñoEvaluacionAnalisisLayout = new javax.swing.GroupLayout(jPanelCostosDiseñoEvaluacionAnalisis);
        jPanelCostosDiseñoEvaluacionAnalisis.setLayout(jPanelCostosDiseñoEvaluacionAnalisisLayout);
        jPanelCostosDiseñoEvaluacionAnalisisLayout.setHorizontalGroup(
            jPanelCostosDiseñoEvaluacionAnalisisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostosDiseñoEvaluacionAnalisisLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelGastoItems, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelCostosDiseñoEvaluacionAnalisisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanelFactorCosto, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelTotalCosto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelCostosDiseñoEvaluacionAnalisisLayout.setVerticalGroup(
            jPanelCostosDiseñoEvaluacionAnalisisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCostosDiseñoEvaluacionAnalisisLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelCostosDiseñoEvaluacionAnalisisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelGastoItems, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelCostosDiseñoEvaluacionAnalisisLayout.createSequentialGroup()
                        .addComponent(jPanelFactorCosto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelTotalCosto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanelCostosReparacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Costos por Fase de Reparación", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jPanelCantidad.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Cantidad"));

        jLabelHorasReparacion.setText("Horas de Reparación:");

        jLabelNumeroDesarrolladores.setText("Número de desarrolladores:");

        jTextFieldHorasReparacion.setToolTipText("Ingrese un número entero positivo");
        jTextFieldHorasReparacion.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldHorasReparacion.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldHorasReparacion.setPreferredSize(new java.awt.Dimension(100, 20));

        jTextFieldValorNumeroDesarrolladores.setToolTipText("Ingrese un número entero positivo");
        jTextFieldValorNumeroDesarrolladores.setMaximumSize(new java.awt.Dimension(100, 20));
        jTextFieldValorNumeroDesarrolladores.setMinimumSize(new java.awt.Dimension(100, 20));
        jTextFieldValorNumeroDesarrolladores.setPreferredSize(new java.awt.Dimension(100, 20));

        javax.swing.GroupLayout jPanelCantidadLayout = new javax.swing.GroupLayout(jPanelCantidad);
        jPanelCantidad.setLayout(jPanelCantidadLayout);
        jPanelCantidadLayout.setHorizontalGroup(
            jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCantidadLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelHorasReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                    .addComponent(jLabelNumeroDesarrolladores, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jTextFieldValorNumeroDesarrolladores, 0, 0, Short.MAX_VALUE)
                    .addComponent(jTextFieldHorasReparacion, javax.swing.GroupLayout.PREFERRED_SIZE, 88, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelCantidadLayout.setVerticalGroup(
            jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCantidadLayout.createSequentialGroup()
                .addGroup(jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHorasReparacion)
                    .addComponent(jTextFieldHorasReparacion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelCantidadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNumeroDesarrolladores)
                    .addComponent(jTextFieldValorNumeroDesarrolladores, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanelDesarrollador.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Valor HH Desarrollador"));
        jPanelDesarrollador.setPreferredSize(new java.awt.Dimension(200, 88));

        jTextFieldValorHHDesarrolladorPesos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldValorHHDesarrolladorPesos.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldValorHHDesarrolladorPesos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldValorHHDesarrolladorPesosKeyReleased(evt);
            }
        });

        jTextFieldValorHHDesarrolladorUF.setEnabled(false);
        jTextFieldValorHHDesarrolladorUF.setPreferredSize(new java.awt.Dimension(80, 20));
        jTextFieldValorHHDesarrolladorUF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldValorHHDesarrolladorUFKeyReleased(evt);
            }
        });

        jRadioButtonHHPesos.setText("Pesos($)");
        jRadioButtonHHPesos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jRadioButtonHHPesosMouseClicked(evt);
            }
        });

        jRadioButtonHHUf.setText("U.F.");
        jRadioButtonHHUf.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jRadioButtonHHUfMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanelDesarrolladorLayout = new javax.swing.GroupLayout(jPanelDesarrollador);
        jPanelDesarrollador.setLayout(jPanelDesarrolladorLayout);
        jPanelDesarrolladorLayout.setHorizontalGroup(
            jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDesarrolladorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jRadioButtonHHPesos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldValorHHDesarrolladorPesos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE)
                .addGroup(jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jRadioButtonHHUf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldValorHHDesarrolladorUF, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelDesarrolladorLayout.setVerticalGroup(
            jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDesarrolladorLayout.createSequentialGroup()
                .addGroup(jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButtonHHPesos)
                    .addComponent(jRadioButtonHHUf))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelDesarrolladorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldValorHHDesarrolladorPesos, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldValorHHDesarrolladorUF, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
        );

        javax.swing.GroupLayout jPanelCostosReparacionLayout = new javax.swing.GroupLayout(jPanelCostosReparacion);
        jPanelCostosReparacion.setLayout(jPanelCostosReparacionLayout);
        jPanelCostosReparacionLayout.setHorizontalGroup(
            jPanelCostosReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCostosReparacionLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelDesarrollador, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanelCostosReparacionLayout.setVerticalGroup(
            jPanelCostosReparacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelCantidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanelDesarrollador, 0, 77, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelValorUF, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelCostosDiseñoEvaluacionAnalisis, javax.swing.GroupLayout.DEFAULT_SIZE, 622, Short.MAX_VALUE)
                    .addComponent(jPanelCostosReparacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelValorUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelCostosDiseñoEvaluacionAnalisis, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelCostosReparacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldGastosOperacionalesPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosOperacionalesPesosKeyReleased
        this.calculaUF(jTextFieldGastosOperacionalesPesos, jTextFieldGastosOperacionalesUF);
    }//GEN-LAST:event_jTextFieldGastosOperacionalesPesosKeyReleased

    private void jTextFieldGastosMaterialApoyoPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosMaterialApoyoPesosKeyReleased
        this.calculaUF(jTextFieldGastosMaterialApoyoPesos, jTextFieldGastosMaterialApoyoUF);
    }//GEN-LAST:event_jTextFieldGastosMaterialApoyoPesosKeyReleased

    private void jTextFieldInsumosPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldInsumosPesosKeyReleased
        this.calculaUF(jTextFieldInsumosPesos, jTextFieldInsumosUF);
    }//GEN-LAST:event_jTextFieldInsumosPesosKeyReleased

    private void jTextFieldGastosBasicosPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosBasicosPesosKeyReleased
        this.calculaUF(jTextFieldGastosBasicosPesos, jTextFieldGastosBasicosUF);
    }//GEN-LAST:event_jTextFieldGastosBasicosPesosKeyReleased

    private void jTextFieldGastosMovilizacionPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosMovilizacionPesosKeyReleased
        this.calculaUF(jTextFieldGastosMovilizacionPesos, jTextFieldGastosMovilizacionUF);
    }//GEN-LAST:event_jTextFieldGastosMovilizacionPesosKeyReleased

    private void jTextFieldGastosCoffeBreaksPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosCoffeBreaksPesosKeyReleased
        this.calculaUF(jTextFieldGastosCoffeBreaksPesos, jTextFieldGastosCoffeBreaksUF);
    }//GEN-LAST:event_jTextFieldGastosCoffeBreaksPesosKeyReleased

    private void jTextFieldGastosAlimentacionPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosAlimentacionPesosKeyReleased
        this.calculaUF(jTextFieldGastosAlimentacionPesos, jTextFieldGastosAlimentacionUF);
    }//GEN-LAST:event_jTextFieldGastosAlimentacionPesosKeyReleased

    private void jTextFieldGastosServiciosExternosPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosServiciosExternosPesosKeyReleased
        this.calculaUF(jTextFieldGastosServiciosExternosPesos, jTextFieldGastosServiciosExternosUF);
    }//GEN-LAST:event_jTextFieldGastosServiciosExternosPesosKeyReleased

    private void jTextFieldArriendoOficinaPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldArriendoOficinaPesosKeyReleased
        this.calculaUF(jTextFieldArriendoOficinaPesos, jTextFieldArriendoOficinaUF);
    }//GEN-LAST:event_jTextFieldArriendoOficinaPesosKeyReleased

    private void jTextFieldValorUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldValorUFKeyReleased
        this.setUF(jTextFieldValorUF);//Se instancia el valor de la UF
            /* al existir un cambio, se calculan los gastos en UF*/
        calculaUFes();
    }//GEN-LAST:event_jTextFieldValorUFKeyReleased

    private void jTextFieldValorHHDesarrolladorPesosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldValorHHDesarrolladorPesosKeyReleased
        this.calculaUF(jTextFieldValorHHDesarrolladorPesos, jTextFieldValorHHDesarrolladorUF);
    }//GEN-LAST:event_jTextFieldValorHHDesarrolladorPesosKeyReleased

	private void jButtonValorUfInternetActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonValorUfInternetActionPerformed
            try {
                if (jTextFieldValorUF.getText().equals("") && botonUfInternetUsado) {
                    botonUfInternetUsado = false;
                }
                URL url = new URL("http://www.economiaynegocios.cl");
                URLConnection urlc = url.openConnection();
                InputStream is = urlc.getInputStream();
                urlc = null;
                url = null;
                BufferedReader bf = new BufferedReader(new InputStreamReader(is));
                String linea;
                while (!(linea = bf.readLine()).matches(".*UF.*"));
                for (int i = 0; i < 4; i++) {
                    linea = bf.readLine();
                }
                linea = linea.replaceAll("[^0123456789,]", "");
                linea = linea.replace(",", ".");
                double a = Double.parseDouble(linea);
                jTextFieldValorUF.setText(String.valueOf(a));
                this.setUF(jTextFieldValorUF);
                if (!botonUfInternetUsado) {
                    valorp1 = 1;
                    botonUfInternetUsado = true;
                    actualizarbarra();
                }
                calculaUFes();
            } catch (Exception ex) {
                TimingUtils.showTimedBalloon(new BalloonTip(jButtonValorUfInternet, "Ocurrió un problema al intentar conectarse con "
                        + "el servidor de indicadores económicos", new MinimalBalloonStyle(new Color(231, 225, 165), 2), BalloonTip.Orientation.RIGHT_ABOVE,
                        BalloonTip.AttachLocation.ALIGNED, 20, 10, false), 5000);
            }
	}//GEN-LAST:event_jButtonValorUfInternetActionPerformed

        private void jTextFieldValorFactorCostoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldValorFactorCostoKeyReleased
            /* Se calcula el costo total para el factor costo*/
            if (!jTextFieldGastosTotalPesos.getText().isEmpty()) {
                float totalPeso = Integer.parseInt(jTextFieldGastosTotalPesos.getText()) * (Float.parseFloat(jTextFieldValorFactorCosto.getText()) / 100);
                int totalP = (int) totalPeso;
                jTextFieldTotalCostoPesos.setText(String.valueOf(totalP));

                valorTextField = Integer.parseInt(jTextFieldTotalCostoPesos.getText());
                float resultadoUF = ValidaDecimal.roundNum(((float) valorTextField) / valorUF);
                jTextFieldTotalCostoUF.setText(String.valueOf(resultadoUF));
            }

        }//GEN-LAST:event_jTextFieldValorFactorCostoKeyReleased

        private void jTextFieldGastosTotalUFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldGastosTotalUFActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_jTextFieldGastosTotalUFActionPerformed

        private void jTextFieldGastosCoffeBreaksPesosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldGastosCoffeBreaksPesosActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_jTextFieldGastosCoffeBreaksPesosActionPerformed

        private void jTextFieldGastosAlimentacionPesosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldGastosAlimentacionPesosActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_jTextFieldGastosAlimentacionPesosActionPerformed

        private void jTextFieldArriendoOficinaUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldArriendoOficinaUFKeyReleased
            this.calculaPeso(jTextFieldArriendoOficinaPesos, jTextFieldArriendoOficinaUF);
        }//GEN-LAST:event_jTextFieldArriendoOficinaUFKeyReleased

        private void jTextFieldGastosOperacionalesUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosOperacionalesUFKeyReleased
            this.calculaPeso(jTextFieldGastosOperacionalesPesos, jTextFieldGastosOperacionalesUF);
        }//GEN-LAST:event_jTextFieldGastosOperacionalesUFKeyReleased

        private void jTextFieldGastosMaterialApoyoUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosMaterialApoyoUFKeyReleased
            this.calculaPeso(jTextFieldGastosMaterialApoyoPesos, jTextFieldGastosMaterialApoyoUF);
        }//GEN-LAST:event_jTextFieldGastosMaterialApoyoUFKeyReleased

        private void jTextFieldInsumosUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldInsumosUFKeyReleased
            this.calculaPeso(jTextFieldInsumosPesos, jTextFieldInsumosUF);
        }//GEN-LAST:event_jTextFieldInsumosUFKeyReleased

        private void jTextFieldGastosBasicosUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosBasicosUFKeyReleased
            this.calculaPeso(jTextFieldGastosBasicosPesos, jTextFieldGastosBasicosUF);
        }//GEN-LAST:event_jTextFieldGastosBasicosUFKeyReleased

        private void jTextFieldGastosMovilizacionUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosMovilizacionUFKeyReleased
            this.calculaPeso(jTextFieldGastosMovilizacionPesos, jTextFieldGastosMovilizacionUF);
        }//GEN-LAST:event_jTextFieldGastosMovilizacionUFKeyReleased

        private void jTextFieldGastosCoffeBreaksUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosCoffeBreaksUFKeyReleased
            this.calculaPeso(jTextFieldGastosCoffeBreaksPesos, jTextFieldGastosCoffeBreaksUF);
        }//GEN-LAST:event_jTextFieldGastosCoffeBreaksUFKeyReleased

        private void jTextFieldGastosAlimentacionUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosAlimentacionUFKeyReleased
            this.calculaPeso(jTextFieldGastosAlimentacionPesos, jTextFieldGastosAlimentacionUF);
        }//GEN-LAST:event_jTextFieldGastosAlimentacionUFKeyReleased

        private void jTextFieldGastosServiciosExternosUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldGastosServiciosExternosUFKeyReleased
            this.calculaPeso(jTextFieldGastosServiciosExternosPesos, jTextFieldGastosServiciosExternosUF);
        }//GEN-LAST:event_jTextFieldGastosServiciosExternosUFKeyReleased

        private void jRadioButton2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jRadioButton2KeyReleased
            // TODO add your handling code here:
            //this.jRadioButton1.setSelected(false);
        }//GEN-LAST:event_jRadioButton2KeyReleased

        private void jRadioButton1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jRadioButton1KeyReleased
            // TODO add your handling code here:
           // this.jRadioButton2.setSelected(false);
        }//GEN-LAST:event_jRadioButton1KeyReleased

        private void jRadioButton1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jRadioButton1KeyPressed
            // TODO add your handling code here:
           // this.jRadioButton2.setSelected(false);
        }//GEN-LAST:event_jRadioButton1KeyPressed

        private void jRadioButton2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jRadioButton2KeyPressed
            // TODO add your handling code here:
            //this.jRadioButton1.setSelected(false);
        }//GEN-LAST:event_jRadioButton2KeyPressed
//frupo 3 deicion de pesos y uf en ingreso de gastos
        private void jRadioButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButton2MouseClicked
            // TODO add your handling code here:
            this.jRadioButton1.setSelected(false);
              this.jTextFieldArriendoOficinaPesos.setEnabled(false);
            this.jTextFieldGastosOperacionalesPesos.setEnabled(false);
            this.jTextFieldGastosMaterialApoyoPesos.setEnabled(false);
            this.jTextFieldInsumosPesos.setEnabled(false);
            this.jTextFieldGastosBasicosPesos.setEnabled(false);
            this.jTextFieldGastosMovilizacionPesos.setEnabled(false);
            this.jTextFieldGastosCoffeBreaksPesos.setEnabled(false);
            this.jTextFieldGastosAlimentacionPesos.setEnabled(false);
            this.jTextFieldGastosServiciosExternosPesos.setEnabled(false);

            this.jTextFieldArriendoOficinaUF.setEnabled(true);
            this.jTextFieldGastosOperacionalesUF.setEnabled(true);
            this.jTextFieldGastosMaterialApoyoUF.setEnabled(true);
            this.jTextFieldInsumosUF.setEnabled(true);
            this.jTextFieldGastosBasicosUF.setEnabled(true);
            this.jTextFieldGastosMovilizacionUF.setEnabled(true);
            this.jTextFieldGastosCoffeBreaksUF.setEnabled(true);
            this.jTextFieldGastosAlimentacionUF.setEnabled(true);
            this.jTextFieldGastosServiciosExternosUF.setEnabled(true);
        }//GEN-LAST:event_jRadioButton2MouseClicked

        private void jRadioButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButton1MouseClicked
            // TODO add your handling code here:
            this.jRadioButton2.setSelected(false);
             this.jTextFieldArriendoOficinaUF.setEnabled(false);
            this.jTextFieldGastosOperacionalesUF.setEnabled(false);
            this.jTextFieldGastosMaterialApoyoUF.setEnabled(false);
            this.jTextFieldInsumosUF.setEnabled(false);
            this.jTextFieldGastosBasicosUF.setEnabled(false);
            this.jTextFieldGastosMovilizacionUF.setEnabled(false);
            this.jTextFieldGastosCoffeBreaksUF.setEnabled(false);
            this.jTextFieldGastosAlimentacionUF.setEnabled(false);
            this.jTextFieldGastosServiciosExternosUF.setEnabled(false);

            this.jTextFieldArriendoOficinaPesos.setEnabled(true);
            this.jTextFieldGastosOperacionalesPesos.setEnabled(true);
            this.jTextFieldGastosMaterialApoyoPesos.setEnabled(true);
            this.jTextFieldInsumosPesos.setEnabled(true);
            this.jTextFieldGastosBasicosPesos.setEnabled(true);
            this.jTextFieldGastosMovilizacionPesos.setEnabled(true);
            this.jTextFieldGastosCoffeBreaksPesos.setEnabled(true);
            this.jTextFieldGastosAlimentacionPesos.setEnabled(true);
            this.jTextFieldGastosServiciosExternosPesos.setEnabled(true);
        }//GEN-LAST:event_jRadioButton1MouseClicked
//grupo 3 edicion de uf en valor HH
        private void jRadioButtonHHUfMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButtonHHUfMouseClicked
            // TODO add your handling code here:
            this.jRadioButtonHHPesos.setSelected(false);
            this.jTextFieldValorHHDesarrolladorPesos.setEnabled(false);
            this.jTextFieldValorHHDesarrolladorUF.setEnabled(true);
        }//GEN-LAST:event_jRadioButtonHHUfMouseClicked

        private void jRadioButtonHHPesosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButtonHHPesosMouseClicked
            // TODO add your handling code here:
            this.jRadioButtonHHUf.setSelected(false);
            this.jTextFieldValorHHDesarrolladorPesos.setEnabled(true);
            this.jTextFieldValorHHDesarrolladorUF.setEnabled(false);
        }//GEN-LAST:event_jRadioButtonHHPesosMouseClicked

        private void jTextFieldValorHHDesarrolladorUFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldValorHHDesarrolladorUFKeyReleased
            // TODO add your handling code here:
            this.calculaPeso(this.jTextFieldValorHHDesarrolladorPesos,this.jTextFieldValorHHDesarrolladorUF);
        }//GEN-LAST:event_jTextFieldValorHHDesarrolladorUFKeyReleased
        
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonValorUfInternet;
    private javax.swing.JLabel jLabelArriendoOficina;
    private javax.swing.JLabel jLabelFactorCosto;
    private javax.swing.JLabel jLabelGastosAlimentacion;
    private javax.swing.JLabel jLabelGastosBasicos;
    private javax.swing.JLabel jLabelGastosCoffeBreaks;
    private javax.swing.JLabel jLabelGastosMaterialApoyo;
    private javax.swing.JLabel jLabelGastosMovilizacion;
    private javax.swing.JLabel jLabelGastosOperacionales;
    private javax.swing.JLabel jLabelGastosServiciosExternos;
    private javax.swing.JLabel jLabelHorasReparacion;
    private javax.swing.JLabel jLabelIngresoValorUF;
    private javax.swing.JLabel jLabelInsumos;
    private javax.swing.JLabel jLabelNumeroDesarrolladores;
    private javax.swing.JLabel jLabelTotalCostoPesos;
    private javax.swing.JLabel jLabelTotalCostosUF;
    private javax.swing.JLabel jLabelTotalGastos;
    private javax.swing.JPanel jPanelCantidad;
    private javax.swing.JPanel jPanelCostosDiseñoEvaluacionAnalisis;
    private javax.swing.JPanel jPanelCostosReparacion;
    private javax.swing.JPanel jPanelDesarrollador;
    private javax.swing.JPanel jPanelFactorCosto;
    private javax.swing.JPanel jPanelGastoItems;
    private javax.swing.JPanel jPanelTotalCosto;
    private javax.swing.JPanel jPanelValorUF;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButtonHHPesos;
    private javax.swing.JRadioButton jRadioButtonHHUf;
    private javax.swing.JTextField jTextFieldArriendoOficinaPesos;
    private javax.swing.JTextField jTextFieldArriendoOficinaUF;
    private javax.swing.JTextField jTextFieldGastosAlimentacionPesos;
    private javax.swing.JTextField jTextFieldGastosAlimentacionUF;
    private javax.swing.JTextField jTextFieldGastosBasicosPesos;
    private javax.swing.JTextField jTextFieldGastosBasicosUF;
    private javax.swing.JTextField jTextFieldGastosCoffeBreaksPesos;
    private javax.swing.JTextField jTextFieldGastosCoffeBreaksUF;
    private javax.swing.JTextField jTextFieldGastosMaterialApoyoPesos;
    private javax.swing.JTextField jTextFieldGastosMaterialApoyoUF;
    private javax.swing.JTextField jTextFieldGastosMovilizacionPesos;
    private javax.swing.JTextField jTextFieldGastosMovilizacionUF;
    private javax.swing.JTextField jTextFieldGastosOperacionalesPesos;
    private javax.swing.JTextField jTextFieldGastosOperacionalesUF;
    private javax.swing.JTextField jTextFieldGastosServiciosExternosPesos;
    private javax.swing.JTextField jTextFieldGastosServiciosExternosUF;
    private javax.swing.JTextField jTextFieldGastosTotalPesos;
    private javax.swing.JTextField jTextFieldGastosTotalUF;
    private javax.swing.JTextField jTextFieldHorasReparacion;
    private javax.swing.JTextField jTextFieldInsumosPesos;
    private javax.swing.JTextField jTextFieldInsumosUF;
    private javax.swing.JTextField jTextFieldTotalCostoPesos;
    private javax.swing.JTextField jTextFieldTotalCostoUF;
    private javax.swing.JTextField jTextFieldValorFactorCosto;
    private javax.swing.JTextField jTextFieldValorHHDesarrolladorPesos;
    private javax.swing.JTextField jTextFieldValorHHDesarrolladorUF;
    private javax.swing.JTextField jTextFieldValorNumeroDesarrolladores;
    private javax.swing.JTextField jTextFieldValorUF;
    // End of variables declaration//GEN-END:variables
}
